From 907bfe79c5f962b46d9176148946bf41b95be05c Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 23 Mar 2015 13:53:28 -0700 Subject: [PATCH] Make sure test directory exists --- tests/support/paths.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/support/paths.rs b/tests/support/paths.rs index 491990c0a..9abab9a19 100644 --- a/tests/support/paths.rs +++ b/tests/support/paths.rs @@ -3,6 +3,7 @@ use std::fs; use std::io::prelude::*; use std::io::{self, ErrorKind}; use std::path::{Path, PathBuf}; +use std::sync::{Once, ONCE_INIT}; use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; static CARGO_INTEGRATION_TEST_DIR : &'static str = "cit"; @@ -101,6 +102,10 @@ impl CargoPathExt for Path { /// Ensure required test directories exist and are empty pub fn setup() { debug!("path setup; root={}; home={}", root().display(), home().display()); + static INIT: Once = ONCE_INIT; + INIT.call_once(|| { + root().parent().unwrap().mkdir_p().unwrap(); + }); root().rm_rf().unwrap(); home().mkdir_p().unwrap(); } -- 2.30.2